package IDemo;

import java.util.Objects;

/**
 *
 * @author chen
 */
public class Student implements Comparable<Student>{
   int id;
   String name;
   private String Major;

    @Override
    public String toString() {
        return "Student{" + "id=" + id + ", name=" + name + ", Major=" + Major + '}';
    }

    public Student(int id) {
        this.id = id;
    }

    public Student(int id, String name, String Major) {
        this.id = id;
        this.name = name;
        this.Major = Major;
    }

    @Override
    public int compareTo(Student o) {
        return new Integer(id).compareTo(o.id);
    }

    public boolean equals(Student obj)
    {
        if (obj == null) {
            return false;
        }
      
        final Student other = (Student) obj;
        if (this.id != other.id) {
            return false;
        }
  
        return true;
    }

    public String getMajor() {
        return Major;
    }

    public String getName() {
        return name;
    }
    
    
}
